package com.maywide.jdp.system.service;

import java.util.List;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import com.maywide.jdp.system.entities.Operator;

/**
 * 用户管理Service接口
 * 
 * @author luoyang
 * @version 1.0
 * @since JDK1.6
 */
public interface OperatorService extends LockedService {

	/**
	 * 新增用户
	 * 
	 * @param organization
	 *            用户对象
	 * @param request
	 *            HttpServletRequest对象
	 * @return Organization 新增后的对象
	 */
	public Operator insert(Operator operator, HttpServletRequest request,
			HttpServletResponse response, HttpSession session)
			throws Exception;

	/**
	 * 修改用户
	 * 
	 * @param operator
	 *            用户对象
	 * @param request
	 *            HttpServletRequest对象
	 * @return Organization 修改后的对象
	 */
	public Operator update(Operator operator, HttpServletRequest request,
			HttpServletResponse response, HttpSession session)
			throws Exception;

	/**
	 * 修改用户
	 * 
	 * @param operator
	 *            用户对象
	 * @param appType 应用类型
	 * @param request
	 *            HttpServletRequest对象
	 * @return Organization 修改后的对象
	 */
	public Operator updateApp(Operator operator,String appType, HttpServletRequest request,
			HttpServletResponse response, HttpSession session)
			throws Exception;

	/**
	 * 读取用户
	 * 
	 * @param id
	 *            用户ID
	 * @param request
	 *            HttpServletRequest对象
	 * @return Organization 读取的用户对象
	 */
	public Operator load(Long id, HttpServletRequest request,
			HttpServletResponse response, HttpSession session)
			throws Exception;

	/**
	 * 修改某用户的密码
	 * 
	 * @param id
	 *            用户ID
	 * @param newPassword
	 *            新密码
	 * @param request
	 *            HttpServletRequest对象
	 */
	public void changePassword(Long id, String newPassword,
			HttpServletRequest request,
			HttpServletResponse response, HttpSession session) throws Exception;

	/**
	 * 修改自己的密码
	 * 
	 * @param operatorID
	 *            用户帐号
	 * @param prePassword
	 *            老密码
	 * @param newPassword
	 *            新密码
	 * @param request
	 *            HttpServletRequest对象
	 */
	public void changeSelfPassword(String operatorID, String prePassword,
			String newPassword, HttpServletRequest request,
			HttpServletResponse response, HttpSession session) throws Exception;

	/**
	 * @param ids
	 *            移动的节点ID列表
	 * @param oldOrgID
	 *            移动的机构节点ID
	 * @param newOrgID
	 *            移动到的机构节点ID
	 */
	public void move(List<String> ids, String oldOrgID, String newOrgID,
			HttpServletRequest request,
			HttpServletResponse response, HttpSession session) throws Exception;
}
